/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.sais.eswn.card.cardlabel;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;

/**
 *
 * @author Romulus
 */
  public class EventLabel extends CardLabel {

    public EventLabel(ICardLabelCallback parent, int controller, String cardno,boolean isWatcher) {
      super(parent, cardno, controller, isWatcher);
      setPopupMenu();
      addMouseListener(stdml);
    }

    public void setPopupMenu() {
      if (cardno == null) {
        return;
      }
      mMenu = new JPopupMenu();
      JMenuItem title = new JMenuItem(getInfo().name);

      mMenu.add(title);
      mMenu.addSeparator();
      if (isWatcher) {
        add(mMenu);
        return;
      }

/*      for (int k = 0; k < 3; ++k) {
        JMenuItem item = new JMenuItem(Tools.loc[172 + k]);
        int targetregion = MainFrame.REGION_GRAVE;
        switch (k) {
          case 0:
            targetregion = MainFrame.REGION_GRAVE;
            break;
          case 1:
            targetregion = MainFrame.REGION_HAND;
            break;
          case 2:
            targetregion = MainFrame.REGION_LIBRARY;
            break;
        }
        item.addActionListener(new EventCommandListener(targetregion));
        mMenu.add(item);
      }

      add(mMenu);*/
    }

    class EventCommandListener implements ActionListener {

      int targetregion;

      EventCommandListener(int targetregion) {
        this.targetregion = targetregion;
      }

      @Override
      public void actionPerformed(ActionEvent e) {
        //parent.EventMove(targetregion);
      }
    }
  }